/*
 * Copyright 2014, Gregg Tavares.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Gregg Tavares. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* set all elements to use border-box sizing. Yay! */
* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/* make the body full size, FF needs html there? */
html, body {
  width: 100%;
  height: 100%;
  border: 0px;
  padding: 0px;
  margin: 0px;
  font-family: Helvetica, Arial, sans-serif;
  overflow: hidden;
}
/* class to make something full size */
.hft-fullsize {
  width: 100%;
  height: 100%;
}
.hft-top-left {
  position: absolute;
  left: 0;
  top: 0;
}
/* class to make a column based flexbox with everything centered */
.hft-fullcenter {
  width: 100%;
  height: 100%;

  display: -webkit-box;
  display: -webkit-flex;
  display: flex;

  -webkit-box-orient: vertical;
  -webkit-flex-flow: column;
  flex-flow: column;

  -webkit-box-align: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -webkit-align-content: center;
  -webkit-align-items: center;

  justify-content: center;
  align-content: center;
  align-items: center;

  min-height: auto;
}
/* This is everything.
 *
 * It's basically body. It's needed to rotate all content
 * when we need to force an orientation
 */
#hft-everything {
  position: relative;
  width: 100%;
  height: 100%;
}
#hft-content {
  position: relative;
  width: 100%;
  height: 100%;
}
/* left header area */
#hft-nameentry {
  display: none;
}
#hft-nameentry>div>div {
  background: -webkit-linear-gradient(top, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%);
  background: linear-gradient(to bottom, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%);
  padding: 2em;
  border-radius: 2em;
}
#hft-nameform {
  margin: 0.5em;
}
#hft-nameform label {
  font-size: x-large;
  font-weight: bold;
  margin-bottom: 0.5em;
  display: block;
}
#hft-name
{
  width: 100%;
  font-size: x-large;
  font-weight: bold;
  color: #444;
  border: none;
  outline: 2px solid #07F;
  padding: 10px;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
#hft-menu {
  position: absolute;
  right: 0.5em;
  top: 0.5em;
  z-index: 4999;
}
.hft-instruction {
  font-size: xx-large;
  font-weight: bold;
  text-align: center;
}
/* phone landscape */
@media only screen and (min-device-width : 320px) and (max-device-width: 568px) and (orientation: landscape) {
    #hft-name {
        font-size: large;
    }
    #hft-nameform label {
        font-size: large;
        font-weight: bold;
    }
    .hft-instruction {
        font-size: x-large;
    }
}
#hft-status {
  position: absolute;
  padding: 1em;
  background-color: rgba(0,0,0,0.5);
  border-radius: 1em;
  z-index: 5;
  color: white;
  margin: 5px;
  font-size: small;
}
#hft-debug {
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: 10;
  display: none;
}
#hft-disconnected {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-color: blue;
  color: white;
  text-align: center;
  z-index: 1000;
  font-size: 48pt;
  font-weight: bold;
}
#hft-settings,
#hft-nameentry {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.75);

  display: none;
}
.hft-menubutton {
  border-radius: 1em;
  background: -webkit-linear-gradient(top, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%);
  background: linear-gradient(to bottom, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%);
  width: 80%;
  margin: 0.2em;
}
.hft-menubutton div {
  width: 100%;
  padding-left: 0.5em;
  height: 1.5em;
  display: table-cell;
  text-align: center;
  vertical-align: middle;
  font-size: x-large;
  font-weight: bold;
}
#hft-portrait {
  display: none;
}
#hft-landscape {
  display: none;
}
.hft-xlarge {
  font-size: 150pt;
  font-weight: bold;
  padding: 0px;
  margin: 0px;
  text-align: center;
  line-height: 1;
}

#hft-touchstart {
    display: none;
    z-index: 10000;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
}

.hft-dialog-cover {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.8);
    width: 100%;
    height: 100%;
}

.hft-dialog-container {
    background: linear-gradient(to bottom, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%);
    border-top: 10px solid black;
    border-bottom: 10px solid black;
    color: #000;
    width: 100%;
}

.hft-dialog-title {
    padding: 0.5em 20px 0.5em 20px;
    background-color: #68A;
    font-size: larger;
    font-weight: bolder;
}

.hft-dialog-choice {
    padding: 10px 20px 10px 20px;
    margin: 0.5em;
    border: 5px solid blue;
    border-radius: 10px;
    background-color: #BDF;
}

.hft-dialog-content {
    padding: 20px;
}


@media only screen and (max-width : 480px) and (orientation: portrait) {
  #hft-portrait {
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: red;
    color: white;
    z-index: 4998;

    display: -webkit-box;
    display: -webkit-flex;
    display: flex;

  }

  .hft-portrait-rot90 {
      -webkit-transform: rotate(90deg);
      -moz-transform: rotate(90deg);
      -o-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
      transform: rotate(90deg);
  }
}

@media only screen and (max-width: 800px) and (orientation: landscape) {
  #hft-landscape {
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: red;
    color: white;
    z-index: 4998;

    display: -webkit-box;
    display: -webkit-flex;
    display: flex;

  }

  .hft-landscape-rot90 {
      -webkit-transform: rotate(90deg);
      -moz-transform: rotate(90deg);
      -o-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
      transform: rotate(90deg);
  }
}

/*
.hft-portrait-to-landscape {
  g-webkit-transform: rotate(90deg) translate(26px, 26px);
  -webkit-transform: rotate(90deg) translate(104px, 104px);
  g-moz-transform: rotate(90deg);
  g-o-transform: rotate(90deg);
  g-ms-transform: rotate(90deg);
  gtransform: rotate(90deg);
}
*/

/* iOS 6 the chrome takes more space */
@media only screen and (max-height : 208px) {
    #hft-header {
    }

    #hft-nameform {
        margin: 2px 0.5em 2px 0.5em; /* TRouBLe */
    }
    #hft-menu>img {
        height: 16%;
    }

    .hft-menubutton div {
        height: 1.5em;
        font-size: x-large;
    }
}

